'use strict';

define(['services'], function (services) {
    services.collection.register('SchemaService', ['$http', function ($http) {
        return {
            query : function (collectionId, callback) {
                $http.get('/rest/collection/' + collectionId + '/schema', {}).success(function (data, status, headers, config) {
                    if (callback != null) {
                        callback(eval(data), status, headers, config);
                    }
                });
            }
        };
    }]);
});